package com.mls.fivedistrict.server;

import com.mls.fivedistrict.common.PageFilter;
import com.mls.fivedistrict.common.ServiceResponse;
import com.mls.fivedistrict.pojo.ParadropProperty;
import com.mls.fivedistrict.pojo.Property;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * Created by nanji on 2018/3/16.
 */
public interface PropertyService {
    /**
     * 获取资产详情
     *
     * @param id
     * @param userId
     * @return
     */
    Property getProperty(Long id, Long userId);

    ServiceResponse getPropertyByIntegral(Long integralId, Long userId);

    /**
     * 通过调节获取积分详情
     *
     * @param filter
     * @return
     */
    ServiceResponse getDetailByFilter(Map filter);

    /**
     * 获取资产列表
     *
     * @param pageFilter
     * @return
     */
    ServiceResponse getProperties(PageFilter pageFilter);

    boolean addProperty(Property property);

    ServiceResponse editProperty(Property property);

    Property getPropertyDetail(Long id);

    Property getPropertyDetailByIntegral(Long integralId, Long userId);

    ServiceResponse insertProperty(Property property);

    /**
     * 删除用户积分
     *
     * @param userId
     * @param sourceStatus
     */
    int deleteUserProperty(Long userId, String sourceStatus);

    BigDecimal getDwqTotal();

    /**
     * 通过积分ID获取资产列表
     *
     * @param intergral
     * @return
     */
    List<Property> getPropertiesByIntegral(Long intergral);

    /**
     * 通过用户ID获取所有资产
     * @param userId
     * @return
     */
    List<Property> getPropertiesByUserId(PageFilter pageFilter,Long userId);

    /**
     * 批量插入资产通过积分
     *
     * @param insertPropertyList
     */
    void addPropertyBashByParadrop(List<ParadropProperty> insertPropertyList);

    /**
     * 查询某种积分对应的用户集合
     *
     * @param integralId
     * @return
     */
    List<Long> getUserIds(Long integralId);

    int updatePropertyBashByParadrop(List<ParadropProperty> updatePropertyList);

    /**
     * 修改资产通过接受的记录
     * @param id
     * @param recordValue
     * @return
     */
    int editPropertyByRecord(Long id, BigDecimal recordValue);

    /**
     * 减少资产
     * @param userId
     * @param integralId
     * @param value
     */
    int reducePropertyTotal(Long userId, Long integralId, BigDecimal value);

    int increatementPropertyTotal(Long userId, Long integralId, BigDecimal value);

    Property getDWQDetail(Long userId);

    /**
     * 添加指定用户的积分资产
     * @param integralId
     * @param integralValue
     * @param userId
     */
    Long addPropertyByIntegral(long integralId, BigDecimal integralValue, Long userId);
}
